//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
      banner:""
  },
  onLoad: function () {
    if(!wx.getStorageSync('token')){
        wx.reLaunch({
          url: '/pages/login/index',
        })
    }
    this.getBanner()
  },
  getBanner(){
    app.post('index/banner').then(res=>{
      console.log("banner",res)
      let url = app.data.url + res.data[0].image;
      this.setData({
        banner:url
      })
    })
  }
})
